.class public Lcom/waiqin365/h5/customer/WqCustomerTypePicker;
.super Lorg/apache/cordova/CordovaPlugin;

# interfaces
.implements Ljava/util/Observer;


# instance fields
.field public final a:Ljava/lang/String;

.field private b:Lorg/apache/cordova/WqCordovaActivity;

.field private c:Lorg/apache/cordova/CallbackContext;

.field private d:Ljava/util/ArrayList;

.field private e:Lcom/waiqin365/base/db/cmfilteritem/a;

.field private f:Lorg/apache/cordova/CordovaArgs;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/UUID;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a:Ljava/lang/String;

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;Lcom/waiqin365/base/db/cmfilteritem/a;)Lcom/waiqin365/base/db/cmfilteritem/a;
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->e:Lcom/waiqin365/base/db/cmfilteritem/a;

    return-object p1
.end method

.method static synthetic a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;Ljava/util/ArrayList;)Ljava/util/ArrayList;
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->d:Ljava/util/ArrayList;

    return-object p1
.end method

.method static synthetic a(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/CordovaArgs;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->f:Lorg/apache/cordova/CordovaArgs;

    return-object v0
.end method

.method static synthetic b(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lcom/waiqin365/base/db/cmfilteritem/a;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->e:Lcom/waiqin365/base/db/cmfilteritem/a;

    return-object v0
.end method

.method static synthetic c(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Lorg/apache/cordova/WqCordovaActivity;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->b:Lorg/apache/cordova/WqCordovaActivity;

    return-object v0
.end method

.method static synthetic d(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)Ljava/util/ArrayList;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->d:Ljava/util/ArrayList;

    return-object v0
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 2

    iget-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->b:Lorg/apache/cordova/WqCordovaActivity;

    iput-object p3, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->c:Lorg/apache/cordova/CallbackContext;

    iput-object p2, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->f:Lorg/apache/cordova/CordovaArgs;

    iget-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v0}, Lorg/apache/cordova/WqCordovaActivity;->getThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    new-instance v1, Lcom/waiqin365/h5/customer/d;

    invoke-direct {v1, p0}, Lcom/waiqin365/h5/customer/d;-><init>(Lcom/waiqin365/h5/customer/WqCustomerTypePicker;)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    const/4 v0, 0x1

    return v0
.end method

.method public update(Ljava/util/Observable;Ljava/lang/Object;)V
    .locals 3

    if-eqz p2, :cond_0

    instance-of v0, p2, Lcom/waiqin365/lightapp/view/a/a;

    if-eqz v0, :cond_0

    iget-object v1, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->a:Ljava/lang/String;

    move-object v0, p2

    check-cast v0, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v0, v0, Lcom/waiqin365/lightapp/view/a/a;->a:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    check-cast p2, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v0, p2, Lcom/waiqin365/lightapp/view/a/a;->b:Ljava/lang/Object;

    check-cast v0, Landroid/content/Intent;

    invoke-static {}, Lcom/waiqin365/lightapp/view/a/b;->a()Ljava/util/Observable;

    move-result-object v1

    invoke-virtual {v1, p0}, Ljava/util/Observable;->deleteObserver(Ljava/util/Observer;)V

    if-eqz v0, :cond_0

    const-string/jumbo v1, "cmFilterItem"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/base/db/cmfilteritem/a;

    iput-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->e:Lcom/waiqin365/base/db/cmfilteritem/a;

    iget-object v0, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->e:Lcom/waiqin365/base/db/cmfilteritem/a;

    if-eqz v0, :cond_0

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    :try_start_0
    const-string/jumbo v1, "id"

    iget-object v2, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->e:Lcom/waiqin365/base/db/cmfilteritem/a;

    invoke-virtual {v2}, Lcom/waiqin365/base/db/cmfilteritem/a;->a()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v1, "name"

    iget-object v2, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->e:Lcom/waiqin365/base/db/cmfilteritem/a;

    invoke-virtual {v2}, Lcom/waiqin365/base/db/cmfilteritem/a;->c()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    iget-object v1, p0, Lcom/waiqin365/h5/customer/WqCustomerTypePicker;->c:Lorg/apache/cordova/CallbackContext;

    invoke-virtual {v1, v0}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONObject;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0
.end method
